package com.smitish.vueblog.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smitish.vueblog.entity.Collection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smitish.vueblog.vo.CollectionBlogVO;
import com.smitish.vueblog.vo.CommentUserVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Smitish
 * @since 2020-12-03
 */
public interface CollectionMapper extends BaseMapper<Collection> {

    @Select("SELECT m_collection.*,m_blog.* FROM m_collection,m_blog WHERE m_collection.post_id=m_blog.id AND m_collection.`user_id` = ${user_id} AND type = ${type} ORDER BY created_time DESC")
    List<CollectionBlogVO> getCollectionBlog(Page<CollectionBlogVO> page, @Param("user_id") Long id, @Param("type") Long type);
}
